package com.anjubao.parking.municipal.parkinglot.mapper;

import com.anjubao.parking.municipal.parkinglot.dto.ParkingLotGeomagneticStatusDto;
import com.anjubao.parking.municipal.parkinglot.dto.ParkingLotSlotDto;
import com.anjubao.parking.municipal.parkinglot.dto.ParkingLotSlotReturnDto;
import com.anjubao.parking.municipal.parkinglot.form.ParkingLotSlotScreeningForm;
import com.anjubao.parking.municipal.parkinglot.model.ParkingLotSlot;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author anjubao
 */
@Mapper
@Repository
public interface ParkingLotSlotMapper extends BaseMapper<ParkingLotSlot> {

    /**
     * 根据车场编号获取车场信息
     * @param parkingLotCode
     * @return
     */
    ParkingLotSlot selectByCode(String parkingLotCode);

    /**
     * 根据code删除ParkingLotSlot
     * @param code
     */
    void deleteParkingLotSlot(String code);

    /**
     * 分页
     * @param pagination
     * @param form
     * @return
     */
    List<ParkingLotSlotDto> getFilterParkingLotSlots(Page<ParkingLotSlotDto> pagination, ParkingLotSlotScreeningForm form);

    /**
     * 查询不包含各设备的泊位列表
     * @param parkingLotCode
     * @param parkingLotSlotCodeList
     * @return
     */
    List<ParkingLotSlotDto> getSlotCodes(@Param("parkingLotCode")String parkingLotCode, @Param("parkingLotSlotCodeList") List<Long> parkingLotSlotCodeList);

    /**
     * 根据泊位code获取车位列表
     * @param parkingLotSlotName
     * @return
     */
    List<ParkingLotSlotDto> getParkingLotSlotIdsByName(@Param("parkingLotSlotName") String parkingLotSlotName);

    /**
     * 根据泊位code获取停车场信息
     * @param parkingLotSlotCode
     * @return
     */
    ParkingLotGeomagneticStatusDto getParkingLotByParkingLotSlotCode(String parkingLotSlotCode);

    /**
     * 更新车位状态
     * @param code
     * @param status
     * @return
     */
    ParkingLotSlotReturnDto updateParkingLotSlotsStatus(String code, Integer status);
}
